package com.comac.print.component.app.service;

import com.alibaba.cola.dto.Response;
import com.comac.print.component.app.api.PrintService;
import com.comac.print.component.app.command.cmdExe.MasterPlateUploadMinIOCmdExe;
import com.comac.print.component.app.command.cmdExe.PrintCmdExe;
import com.comac.print.component.app.common.MaterPlateCommon;
import com.comac.print.component.app.common.PrintContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class PrintServiceImpl implements PrintService {

    @Autowired
    private PrintCmdExe printCmdExe;

//    @Autowired
//    private MasterPlateUploadOssCmdExe masterPlateUploadOssCmdExe;
    @Autowired
    private MasterPlateUploadMinIOCmdExe masterPlateUploadMinIOCmdExe;

    @Override
    public Response print(PrintContext printContext) throws Exception {
        return printCmdExe.print(printContext);
    }

    @Override
    public Response uploadFile(MaterPlateCommon materPlateCommon) throws Exception {
        log.info("PrintServiceImpl uploadFile param:{}",materPlateCommon);
        //return masterPlateUploadOssCmdExe.newExecute(materPlateCommon);
        return masterPlateUploadMinIOCmdExe.newExecute(materPlateCommon);
    }
}
